import fetch from "../config/fetch";
/*
 * 登陆
 * */
const loginUrl = "/api/login";
// @ts-ignore
export const login = (data: {} | undefined) => fetch(loginUrl, data, "GET");

/*
 * 修改密码
 * */
const modifyUrl = "/api/user/updatePasswordDo";
export const modify = (data: {} | undefined) => fetch(modifyUrl, data, "GET");
/*
 * 权限管理-部门管理
 * */
const deptUrl = "/api/dept/querydept";
export const deptData = (data: {} | undefined) => fetch(deptUrl, data, "GET");
/*
 * 添加修改
 * */
const editdepturl = "/api/dept/editdept";
export const editdept = (data: {} | undefined) =>
  fetch(editdepturl, data, "GET");
/*
 * 删除
 * */
const delurl = "/api/dept/deldept";
export const deldept = (data: {} | undefined) => fetch(delurl, data, "GET");

/*
 * 用户管理
 *
 * */
const useurl = "/api/user/queryuser";
export const usequery = (data: {} | undefined) => fetch(useurl, data, "GET");
/*
 * 获取所有部门信息
 *
 * */
const allurl = "/api/user/querypdept";
export const alldeptinfo = () => fetch(allurl, "GET");
/*
 * 删除
 * */
const delurls = "/api/user/deluser";
export const delquery = (data: {} | undefined) => fetch(delurls, data, "GET");
/*
 * 添加编辑信息
 * */
const editurl = "/api/user/edituser";
export const edituser = (data: {} | undefined) => fetch(editurl, data, "GET");
/*
 * 资源管理-获取数据
 * */
const resurl = "/api/resource/queryresource";
export const resdata = (data: {} | undefined) => fetch(resurl, data, "GET");

/*
 * 删除
 * */
const resdelurl = "/api/resource/delresource";
export const resdel = (data: {} | undefined) => fetch(resdelurl, data, "GET");
/*
* 保存
* */
const saveurl='/api/resource/editresource';
export const resSave=(data:{} | undefined)=>fetch(saveurl,data,'GET');
/*
* 获取资源信息
* */
const resinfourl='/api/resource/getallresource';
export const resInfo=()=>fetch(resinfourl);

/*
* 角色管理
* */
const roleurl='/api/role/queryrole';
export const queryrole=(data:{}|undefined)=>fetch(roleurl,data,'GET');

/*
* 角色管理-增加
* */
const roleediturl='/api/role/editrole';
export const roleDataEdit=(data:{}| undefined)=>fetch(roleediturl,data,'GET');
/*
* 角色管理-删除
* */
const roledelurl='/api/role/delrole';
export const roleDel=(data:{} |undefined)=>fetch(roledelurl,data,'GET');
/*角色和资源管理*/
const authurl='/api/authorize/queryauthorize';
export const queryauthorize=(data:{} | undefined)=>fetch(authurl,data,'GET');
